package Thread.Executor_demoo;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Executors_demo3 {
    public static void main(String[] args) {
        ExecutorService pool= Executors.newFixedThreadPool(3);
        Future<String> f1 = pool.submit(new mycallable(100));
        Future<String> f2 = pool.submit(new mycallable(200));
        Future<String> f3 = pool.submit(new mycallable(300));
        Future<String> f4 = pool.submit(new mycallable(400));

        try {
            System.out.println(f1.get());
            System.out.println(f2.get());
            System.out.println(f3.get());
            System.out.println(f4.get());
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
